package com.attendance.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.staff.entity.Staff;

@Entity
@Table(name="t_leave")
public class Leave {//请假记录
	private Long id;
	private Staff staff;//员工
	private Date startTime;
	private Date endTime;
	private Staff auditor;//审批人
	private float totalTime; //请假小时数
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.ALL)
	public Staff getStaff() {
		return staff;
	}
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.ALL)
	public Staff getAuditor() {
		return auditor;
	}
	public Date getStartTime() {
		return startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setStaff(Staff staff) {
		this.staff = staff;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public void setAuditor(Staff auditor) {
		this.auditor = auditor;
	}
	public float getTotalTime() {
		return totalTime;
	}
	public void setTotalTime(float totalTime) {
		this.totalTime = totalTime;
	}
	
	
}
